﻿using UnityEngine;

namespace HotPlayer.Physic2D
{
    public abstract class Shape2D
    {
        protected Matrix2D Local2WorldMatrix = new Matrix2D();

        public Matrix2D local2worldMatrix
        {
            get => Local2WorldMatrix;
            set
            {
                Local2WorldMatrix = value;
                UpdatePointsWS();
            }
        }
        
        protected virtual void UpdatePointsWS()
        {
            
        }

        public abstract Vector2 GetFarthestPointInDirection(Vector2 direction);

        public abstract Vector2 AveragePoint();
    }
}